//
//  AddMarketTableViewCell.m
//  联付商圈
//
//  Created by 韩佳睿 on 2017/8/16.
//  Copyright © 2017年 lianfu. All rights reserved.
//

#import "AddMarketTableViewCell.h"

@interface AddMarketTableViewCell()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UITextField *inputInfoTextField;
@property (weak, nonatomic) IBOutlet UIButton *nextBtn;
@property (weak, nonatomic) IBOutlet UIView *lineView;

@end

@implementation AddMarketTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)renderViewWithTitle:(NSString *)title Placeholder:(NSString *)placeholder {
    self.titleLabel.text = title;
    if (![title isEqualToString:@"品牌标志图片"]) {
        self.inputInfoTextField.placeholder = placeholder;
    } else {
        [self.addPhotoBtn addTarget:self action:@selector(selectPhoto) forControlEvents:UIControlEventTouchUpInside];
        self.addPhotoBtn.hidden = NO;
        self.inputInfoTextField.hidden = YES;
    }
    self.nextBtn.hidden = YES;
}

- (void)renderViewWithButton {
    [self.nextBtn addTarget:self action:@selector(nextBtnAction) forControlEvents:UIControlEventTouchUpInside];
    
    self.titleLabel.hidden = YES;
    self.inputInfoTextField.hidden = YES;
    self.lineView.hidden = YES;
}

- (void)selectPhoto {
    if ([self.delegate respondsToSelector:@selector(addPhoto)]) {
        [self.delegate addPhoto];
    }
}

-  (void)nextBtnAction {
    if ([self.delegate respondsToSelector:@selector(nextAction)]) {
        [self.delegate nextAction];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
